//
//  CustomerAlertView.m
//  Project_Demo
//
//  Created by caoxiaozhu on 2018/7/6.
//  Copyright © 2018年 caoxiaozhu. All rights reserved.
//

#import "CustomerAlertView.h"
#import "XZ_AnimationAlertView.h"

@interface CustomerAlertView ()
@property(nonatomic,strong)XZ_AnimationAlertView *animationView;

@end

@implementation CustomerAlertView

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setBtn];
}

-(void)setBtn{
    UIButton *btn = [UIButton createButtonWithFrame:CGRectMake(0, 100, 300, 30) buttonType:kButtonNormal title:@"点击" tag:0 target:self action:@selector(clickMe)];
    btn.centerX = self.view.centerX;
    [self.view addSubview:btn];
}

-(void)clickMe{
    NSLog(@"点击了按钮");
    
    UIView *redView = [UIView new];
    redView.frame = CGRectMake(0, 0, 200, 200);
    redView.backgroundColor = [UIColor redColor];
    _animationView = [[XZ_AnimationAlertView alloc]initWithCustomerView:redView PopStyle:XZ_AnimationPopStyleShakeFromLeft DismissStyle:XZ_AnimationDismissStyleDropToTop PopDuration:1 DismissDuration:1 ClickBacToHide:true BackAlpha:0.5];
    [self.view addSubview:_animationView];
    
//    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]init];
//    [tap addTarget:self action:@selector(click)];
//    [redView addGestureRecognizer:tap];
}

-(void)click{
    [_animationView hideWithDur:1];
}

@end
